package com.itheima.reggie.controller;

import com.itheima.reggie.bean.Dish;
import com.itheima.reggie.bean.Setmeal;
import com.itheima.reggie.common.R;
import com.itheima.reggie.service.SetmealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/setmeal")
public class SetmealController {
    @Autowired
    private SetmealService ss;

    @GetMapping("/list")
    public R list(Long categoryId,Integer status){
        try {
            List<Setmeal> list = ss.findList(categoryId,status);
            return R.success(list);
        } catch (Exception e) {
            e.printStackTrace();
            return R.error("查询失败！");
        }

    }

}
